package com.example.demotask.task;

import com.example.demotask.service.ScheduledTaskJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

/**
 * @author zjc.
 * @data 2021/11/15.
 * @time 17:25
 */

@Component("scheduledTask01")
public class ScheduledTask01 implements ScheduledTaskJob {

    private static final Logger LOGGER = LoggerFactory.getLogger(ScheduledTask01.class);

    private static final DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    @Override
    public void run() {
        LOGGER.info("执行时间"+df.format(LocalDateTime.now())+"ScheduledTask => 01  run  当前线程名称 {} ", Thread.currentThread().getName());
    }


}
